package com.dhx.utils;

import java.sql.Connection;
import java.sql.DriverManager;

public class testttt {
    public static void main(String []args) {
        String driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver";
        String dbURL="jdbc:sqlserver://localhost:1433;DatabaseName=book";
        String userName="sa";
        String userPwd="sa";
        try
        {
            Class.forName(driverName);
            Connection dbConn=DriverManager.getConnection(dbURL,userName,userPwd);
            System.out.println("success!");
        }
        catch(Exception e)
        {
            e.printStackTrace();
            System.out.print("fail!");
        }
    }
}
